{"ast":null,"code":"import _regeneratorRuntime from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _classCallCheck from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/classCallCheck.js\";import _createClass from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/createClass.js\";import apiClient from\"../http\";import{getChatOrNew,getChats}from\"../routes\";var ChatService=/*#__PURE__*/function(){function ChatService(){_classCallCheck(this,ChatService);}_createClass(ChatService,null,[{key:\"getChatsList\",value:function(){var _getChatsList=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:return _context.abrupt(\"return\",apiClient.get(getChats()));case 1:case\"end\":return _context.stop();}}},_callee);}));function getChatsList(){return _getChatsList.apply(this,arguments);}return getChatsList;}()},{key:\"getDialogOrNew\",value:function(){var _getDialogOrNew=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(otherUserId){return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:return _context2.abrupt(\"return\",apiClient.get(getChatOrNew(otherUserId)));case 1:case\"end\":return _context2.stop();}}},_callee2);}));function getDialogOrNew(_x){return _getDialogOrNew.apply(this,arguments);}return getDialogOrNew;}()}]);return ChatService;}();export{ChatService as default};","map":{"version":3,"names":["apiClient","getChatOrNew","getChats","ChatService","get","otherUserId"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/src/services/ChatService.ts"],"sourcesContent":["import apiClient from \"../http\";\nimport {AxiosResponse} from 'axios';\nimport {getChatOrNew, getChats} from \"../routes\"\nimport {ChatsListResponse} from \"../models/response/ChatsListResponse\";\nimport {ChatsListItem} from \"../models/response/ChatsListItem\";\n\nexport default class ChatService {\n    public static async getChatsList(): Promise<AxiosResponse<ChatsListResponse>> {\n        return apiClient.get<ChatsListResponse>(getChats());\n    }\n\n    public static async getDialogOrNew(otherUserId: string): Promise<AxiosResponse<ChatsListItem>> {\n        return apiClient.get<ChatsListItem>(getChatOrNew(otherUserId));\n    }\n}"],"mappings":"skBAAA,MAAOA,UAAS,KAAM,SAAS,CAE/B,OAAQC,YAAY,CAAEC,QAAQ,KAAO,WAAW,IAI3BC,YAAW,mOAC5B,qKACWH,SAAS,CAACI,GAAG,CAAoBF,QAAQ,EAAE,CAAC,wDACtD,qNAED,kBAAmCG,WAAmB,yJAC3CL,SAAS,CAACI,GAAG,CAAgBH,YAAY,CAACI,WAAW,CAAC,CAAC,0DACjE,wIAPgBF,WAAW"},"metadata":{},"sourceType":"module"}